import Vue from 'vue';

export default {

    imagesToBase64() {
        let base64 = '';
        Vue.prototype.canvas(document.querySelector("#capture")).then(canvas => {
            base64 = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
        });
        return base64;
    },

    createForm(ref) {
        let obj = {};
        for (let i = 0; i < ref.length; i++) {
            let key = ref[i].name;
            if (key !== '') {
                obj[key] = {
                    value: ref[i].getAttribute("data-value"),
                    p: ref[i].getAttribute("data-p")
                };
            }
        }
        return obj;
    }
}